#pragma once
#define WIN32_LEAN_AND_MEAN
#include <Windows.h>

struct CharDescriptor
{
	short x, y;
	short Width, Height;
	short XOffset, YOffset;
	short XAdvance;
	short Page;
	short Chnl;

	CharDescriptor() : x( 0 ), y( 0 ), Width( 0 ), Height( 0 ), XOffset( 0 ), YOffset( 0 ),
		XAdvance( 0 ), Page( 0 ), Chnl( 0 )
	{ }
};

struct Charset
{
	unsigned short LineHeight;
	unsigned short Base;
	unsigned short Width, Height;
	unsigned short Pages;
	CharDescriptor Chars[9000];
};

class CDrawText
{
public:
	static CDrawText* GetInstance( void );

	void Print( int fontIndex, const char* szText, int nX, int nY, float fScale, DWORD dwColor );

	bool ParseFont( char* name );
private:
	CDrawText(void);
	~CDrawText(void);
	CDrawText( const CDrawText&);
	CDrawText& operator= ( const CDrawText& );

	Charset m_Charset;

	int		fontID[ 5 ];

	short CharX;
	short CharY;
	short Width;
	short Height;
	short OffsetX;
	short OffsetY;

	int m_nCharWidth;
	int m_nCharHeight;

	int m_nNumCols;
	int m_nNumRows;
};

